package com.zq.spring.config;

import com.zq.spring.bean.OneBean;
import com.zq.spring.springexpand.MyBeanDefinitionRegistryPostProcessor;
import com.zq.spring.springexpand.MyBeanFactoryPostProcessor;
import com.zq.spring.springexpand.MyInstantiationAwareBeanPostProcessor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: zhaoqi
 * @Date: 2020/4/24 0:26
 * @Version 1.0
 */

@Configuration
@ComponentScan("com.zq.learing")
public class DiConfig {

    @Bean
    public MyBeanDefinitionRegistryPostProcessor myBeanDefinitionRegistryPostProcessor() {
        return new MyBeanDefinitionRegistryPostProcessor();
    }


    //  MyBeanFactoryPostProcessor
    @Bean
    public MyBeanFactoryPostProcessor myBeanFactoryPostProcessor() {
        return new MyBeanFactoryPostProcessor();
    }


    @Bean
    public MyInstantiationAwareBeanPostProcessor myInstantiationAwareBeanPostProcessor(){
        return new MyInstantiationAwareBeanPostProcessor();
    }

    //
    @Bean
    public OneBean oneBean(){
        return new OneBean();
    }


}
